package com.example.lottery.controller.param;

import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.validation.annotation.Validated;

import java.util.Date;
import java.util.List;

@Data
public class DrawPrizeParam {
    @NotNull(message = "活动Id不能为空")
    private Long activityId;
    @NotNull(message = "奖品Id不能为空")
    private Long prizeId;

    private String prizeTiers;
    @NotNull(message = "中奖时间不能为空")
    private Date winningTime;

    @NotEmpty(message = "中奖人不能为空")
    @Valid
    private List<Winner> winnerList;
    @Data
    public static class Winner{
        @NotNull(message = "用户Id不能为空")
        private Long userId;
        @NotBlank(message = "用户名不为空")
        private String userName;
    }
}
